home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / misc1 / iv26_w30.zip / EXAMPLES / IDRAW / DRAWING.H < prev    next >
C/C++ Source or Header  |  1992-03-05  |  4KB  |  145 lines

  1. /*
  2.  * Copyright (c) 1987, 1988, 1989 Stanford University
  3.  *
  4.  * Permission to use, copy, modify, distribute, and sell this software and its
  5.  * documentation for any purpose is hereby granted without fee, provided
  6.  * that the above copyright notice appear in all copies and that both that
  7.  * copyright notice and this permission notice appear in supporting
  8.  * documentation, and that the name of Stanford not be used in advertising or
  9.  * publicity pertaining to distribution of the software without specific,
  10.  * written prior permission.  Stanford makes no representations about
  11.  * the suitability of this software for any purpose.  It is provided "as is"
  12.  * without express or implied warranty.
  13.  *
  14.  * STANFORD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  15.  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
  16.  * IN NO EVENT SHALL STANFORD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  17.  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  18.  * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  19.  * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
  20.  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  21.  */
  22.  
  23. // $Header: drawing.h,v 1.13 89/10/09 14:47:50 linton Exp $
  24. // declares class Drawing.
  25.  
  26. #ifndef drawing_h
  27. #define drawing_h
  28.  
  29. #include <InterViews/defs.h>
  30. #include <math.h>
  31.  
  32. // Declare imported types.
  33.  
  34. class CenterList;
  35. class Graphic;
  36. class GroupList;
  37. class IBrush;
  38. class IBrushList;
  39. class IColor;
  40. class IColorList;
  41. class IFont;
  42. class IFontList;
  43. class IPattern;
  44. class IPatternList;
  45. class Page;
  46. class PictSelection;
  47. class Selection;
  48. class SelectionList;
  49. class State;
  50. class Transformer;
  51. class booleanList;
  52.  
  53. // A Drawing contains the user's picture and provides the interface
  54. // through which editing operations modify it.
  55.  
  56. class Drawing {
  57. public:
  58.  
  59.     Drawing(double w, double h, double b);
  60.     ~Drawing();
  61.  
  62.     boolean GetLandscape();
  63.     Page* GetPage();
  64.     void GetPictureTT(Transformer&);
  65.     SelectionList* GetSelectionList();
  66.  
  67.     boolean Writable(const char*);
  68.     boolean Exists(const char*);
  69.     void ClearPicture();
  70.     boolean ReadPicture(const char*, State*);
  71.     boolean PrintPicture(const char*, State*);
  72.     boolean WritePicture(const char*, State*);
  73.     SelectionList* ReadClipboard(State*);
  74.     void WriteClipboard();
  75.  
  76.     void GetBox(Coord&, Coord&, Coord&, Coord&);
  77.     IBrushList* GetBrush();
  78.     CenterList* GetCenter();
  79.     GroupList* GetChildren();
  80.     IColorList* GetFgColor();
  81.     IColorList* GetBgColor();
  82.     SelectionList* GetDuplicates();
  83.     booleanList* GetFillBg();
  84.     IFontList* GetFont();
  85.     int GetNumberOfGraphics();
  86.     GroupList* GetParent();
  87.     IPatternList* GetPattern();
  88.     SelectionList* GetPrevs();
  89.     SelectionList* GetSelections();
  90.  
  91.     Selection* PickSelectionIntersecting(Coord, Coord);
  92.     Selection* PickSelectionShapedBy(Coord, Coord);
  93.     SelectionList* PickSelectionsWithin(Coord, Coord, Coord, Coord);
  94.  
  95.     void Clear();
  96.     void Extend(Selection*);
  97.     void Extend(SelectionList*);
  98.     void Grasp(Selection*);
  99.     void Select(Selection*);
  100.     void Select(SelectionList*);
  101.     void SelectAll();
  102.  
  103.     void Move(float, float);
  104.     void Scale(float, float);
  105.     void Stretch(float, Alignment);
  106.     void Rotate(float);
  107.     void Align(Alignment, Alignment);
  108.     void AlignToGrid();
  109.  
  110.     void SetBrush(IBrush*);
  111.     void SetBrush(IBrushList*);
  112.     void SetCenter(CenterList*);
  113.     void SetFgColor(IColor*);
  114.     void SetFgColor(IColorList*);
  115.     void SetBgColor(IColor*);
  116.     void SetBgColor(IColorList*);
  117.     void SetFillBg(boolean);
  118.     void SetFillBg(booleanList*);
  119.     void SetFont(IFont*);
  120.     void SetFont(IFontList*);
  121.     void SetPattern(IPattern*);
  122.     void SetPattern(IPatternList*);
  123.  
  124.     void Append();
  125.     void Group(GroupList*);
  126.     void InsertAfterPrev(SelectionList*);
  127.     void Prepend();
  128.     void Remove();
  129.     void Replace(Selection*, Selection*);
  130.     void Sort();
  131.     void Ungroup(GroupList*);
  132.  
  133. protected:
  134.  
  135.     int NumberOfGraphics(PictSelection*);
  136.  
  137.     char* clipfilename;        // filename under which to store clippings
  138.     Page* page;            // draws picture
  139.     PictSelection* picture;    // stores picture
  140.     SelectionList* sl;        // lists picked Selections
  141.  
  142. };
  143.  
  144. #endif
  145.